package com.javabasic.algorithm.sword_of_offer;

/**
 * @Author xiongmin
 * @ClassName 旋转数组的最小数字
 * @Description TODO
 * @Date 2019/9/8 18:29
 * @Version 1.0
 **/
public class 旋转数组的最小数字 {
    public int minNumberInRotateArray(int [] array) {
        int len = array.length;
        int result = array[0];

        for (int i = 0; i < len-1; i++) {
            if (array[i] > array[i+1]) {
                result = array[i+1];
                break;
            }
        }
        return result;
    }
}
